const express = require('express')
const searchoperation = require('../controllers/search') // 处理文章请求
// const validate = require('../validator/article') // 配置文章校验
const tokenverify = require('../middleware/tokenverify') // token验证
const router = express.Router()

// 搜索联想建议
router.get('/suggest', searchoperation.getSearchSuggest)

// 搜索结果
router.get('/results', searchoperation.getSearchResults)

// 用户搜索历史
router.get('/history', tokenverify, searchoperation.getSearchHistory)

// 删除用户单个历史记录
// router.delete('/delHistory')

// 删除用户全部历史记录
router.delete('/delHistory/all')
module.exports = router
